.TH DHEXVIEW 1 "10 July 2008"
.SH NAME
dhexview \- hex viewer with colors and other nifty features
.SH SYNOPSIS
.I dhexview
[options] filename
.SH DESCRIPTION
.LP
.I dhexview
is a hex viewer (not editor) geared towards reverse engineering work.  It
has features that normal hex editors do not have (nor do they need them).
It supports bookmarks that survive between sessions and has a flexible
coloring and highlighting mechanism.
.SH OPTIONS
.TP
.I "\-f file"
Read configuration file (see CONFIGURATION FILES below).  May be specified
many times.
.TP
.I "\-h"
Display usage information screen and exit.
.SH COMMANDS
.SS Moving Around
.TS
tab(@) ;
l l.
Right@next character
Left@previous character
Down@next line
Up@previous line
Return@go to
PgUp@screen forward
PgDown@screen backward
p@to beginning of next page (see `page_size' option below)
P@to beginning of previous page
<@go to the beginning of the file
>@go to the end of the file
+@specify number of bytes to move cursor forward by
-@specify number of bytes to move cursor backward by
]@interpret two bytes under cursor as uint16 and
@move forward by that many bytes
[@interpret two bytes under cursor as uint16 and
@move backward by that many bytes
}@interpret four bytes under cursor as uint32 and
@move forward by that many bytes
{@interpret four bytes under cursor as uint32 and
@move backward by that many bytes
b@go back in history (previous cursor location)
f@go forward in history
Home@beginning of line
End@end of line
.TE

.SS Searching
.TS
tab(@) ;
l l.
/     @search forward
?@search backward
n@next match forward
N@next match backward
.TE

.SS Colors
.TS
tab(@) ;
l l.
C     @toggle colored display
H@do not highlight current search matches
.TE

.SS Bookmarks
.TS
tab(@) ;
l l.
m     @bookmark a location
g@go to bookmark
l@list bookmarks
X@clear bookmarks
.TE

.SS Miscellaneous
.TS
tab(@) ;
l l.
F1    @help
Ctrl-L@redraw
Ctrl-Z@suspend
Ctrl-C@exit
t@toggle between various modelines
Tab@switch cursor between hex and ascii panes
Esc+L@display the page starting at the current cursor position
.TE

.SS Copy
.TS
tab(@) ;
l l.
Ctrl-Space@set mark
Esc-W@copy
Esc-Y@paste into a file
.TE

.SH MODELINE
At the bottom of the display you have the modeline.
There are several modelines available.
The default modeline displays the name of the file you're currently
viewing and the current position of the cursor in the file followed
by the total file size.  The second modeline displays hexadecimal number
under cursor in binary and decimal notations.
Use 't' command to switch between modelines.

.SH SEARCHING
You can search for a string in ASCII or in hexadecimal. You can switch
between the two with \fITab\fR. If the string is found, the cursor is moved to
the beginning of the matching location. If the search failed, a message (``not
found'') tells you so. You can cancel the search by pressing a key.
.PP
The search in hexadecimal is a bit confusing. You must give a hexadecimal string
with an even number of characters. The search can then be done byte by byte. If
you want to search a long number (eg: a 32 bit number), you must know the
internal representation of that number (little/big endian problem) and give it
the way it is in memory. For example, on an Intel processor (little endian), you
must swap every bytes: 0x12345678 is written 0x78563412 in memory and that's the
string you must give to the search engine.
.PP
For more sophisticated search, see Volker Schatz's patch at
<http://www.volkerschatz.com/unix/homebrew.html#hexedit>.

.SH CONFIGURATION

FIXME: This section of the manual page is to be written.
.PP
dhexview's configuration files are simply Lua files.

.SS Available Options

.SS Coloring Rules

.SS An Example

.SH SEE ALSO
hexedit(1), od(1), hdump(1), hexdump(1), bpe(1), hexed(1), beav(1).

.SH AUTHOR
Dmitri Tikhonov <dtikhonov@yahoo.com>
.br
Based on hexedit by Pixel (Pascal Rigaux) <pixel@rigaux.org> 

.SH LICENSE
\fIdhexview\fR
is licensed under GPL, just like its parent,
\fIhexedit\fR.

.SH LIMITATIONS
There are problems with the curses library given with Redhat 5.0 that make
\fIhexedit\fR think the terminal is huge. The result is that hexedit is
not usable.
.PP
The shortcuts work on some machines, and not on others. That's why there are
many shortcuts for each function. The Ctrl+Arrows and the Alt+. do not work
work as they should most of the time. On SUNs, you must do Ctrl+V-Ctrl+V instead 
of Ctrl+V (!); and the Alt key is the diamond one.
.PP
While searching, it could be interesting to know which position the search has
reached. It's always nice to see something moving to help waiting.
.PP
The hexadecimal search could be able to search modulo 4 bits instead of 8 bits.
Another feature could be to complete padd odd length hexadecimal searches with
zeros.
.SH BUGS
I have an example where the display is completly screwed up. It seems to be a
bug in ncurses (or maybe in xterm and rxvt)?? Don't know if it's me using
ncurses badly or not... It seems to happen when \fIhexedit\fR leaves only one
space at the end of the lines... If anyone has a (or the) solution, please tell
me!
.PP
If you have any problem with the program (even a small one), please do report it
to me. Remarks of any kind are also welcome.
.PP
